/*
 * Course:        COMP 380
 * Semester:      Summer 2012
 * Assignment:    Text To Speech
 * File Name:     Help.java
 * Author:        James Paul Pan
 * 				  Kenneth Wakeland
 * 				  Peter Xaymountry
 * Group #:		  Group #3
 */
package com.comp380.texttospeech;

import android.app.Activity;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.Toast;

/*
 * This class purpose is to let the user what each button in this application
 * do. So all the user have to do is click on a button and their function purpose
 * will pop up.
 */
public class Help extends Activity implements OnClickListener
{
	//Initialize the button variables.
	Button buttonSpeak, buttonSaved, buttonShare, buttonTweet, 
		   buttonPost, buttonDone, buttonDelete, buttonReturn,
		   buttonKeyboard, buttonEraser, buttonFolder, buttonSMS,
		   buttonEmail;
	
	@Override
    public void onCreate(Bundle savedInstanceState) 
    {
    	// Keep the screen orientation in portrait mode.
    	super.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
    	
    	// TODO Auto-generated method stub
        super.onCreate(savedInstanceState);
        
        // Set the layout for this class.
        setContentView(R.layout.help);
        
        // Pass the variable to correspond with the Speak button.
        buttonSpeak = (Button) findViewById(R.id.buttonSpeak);
        
        // When the button is click it goes to the onClick method and pop
        // up a message that tell the user what the Speak button do.
        buttonSpeak.setOnClickListener(this);
        
        // Pass the variable to correspond with the Saved button.
        buttonSaved = (Button) findViewById(R.id.buttonSave);
        
        // When the button is click it goes to the onClick method and pop
        // up a message that tell the user what the Saved button do.
        buttonSaved.setOnClickListener(this);
        
        // Pass the variable to correspond with the Share button.
        buttonShare = (Button) findViewById(R.id.buttonShare);
        
        // When the button is click it goes to the onClick method and pop
        // up a message that tell the user what the Share button do.
        buttonShare.setOnClickListener(this);
        
        // Pass the variable to correspond with the Tweet button.
        buttonTweet = (Button) findViewById(R.id.buttonTweet);
        
        // When the button is click it goes to the onClick method and pop
        // up a message that tell the user what the Tweet button do.
        buttonTweet.setOnClickListener(this);
        
        // Pass the variable to correspond with the Post button.
        buttonPost = (Button) findViewById(R.id.buttonPost);
        
        // When the button is click it goes to the onClick method and pop
        // up a message that tell the user what the Post button do.
        buttonPost.setOnClickListener(this);
        
        // Pass the variable to correspond with the Done button.
        buttonDone = (Button) findViewById(R.id.buttonDone);
        
        // When the button is click it goes to the onClick method and pop
        // up a message that tell the user what the Done button do.
        buttonDone.setOnClickListener(this);
        
        // Pass the variable to correspond with the Delete button.
        buttonDelete = (Button) findViewById(R.id.buttonDelete);
        
        // When the button is click it goes to the onClick method and pop
        // up a message that tell the user what the Delete button do.
        buttonDelete.setOnClickListener(this);
        
        // Pass the variable to correspond with the Return button.
        buttonReturn = (Button) findViewById(R.id.buttonReturn);
        
        // When the button is click it goes to the onClick method and pop
        // up a message that tell the user what the Return button do.
        buttonReturn.setOnClickListener(this);
        
        // Pass the variable to correspond with the Folder button.
        buttonFolder = (Button) findViewById(R.id.buttonFolder);
        
        // When the button is click it goes to the onClick method and pop
        // up a message that tell the user what the Folder button do.
        buttonFolder.setOnClickListener(this);
        
        // Pass the variable to correspond with the Keyboard button.
        buttonKeyboard = (Button) findViewById(R.id.buttonKeyboard);
        
        // When the button is click it goes to the onClick method and pop
        // up a message that tell the user what the Keyboard button do.
        buttonKeyboard.setOnClickListener(this);
        
        
        // Pass the variable to correspond with the Eraser button.
        buttonEraser = (Button) findViewById(R.id.buttonEraser);
        
        // When the button is click it goes to the onClick method and pop
        // up a message that tell the user what the Eraser button do.
        buttonEraser.setOnClickListener(this);
        
        
        // Pass the variable to correspond with the SMS button.
        buttonSMS = (Button) findViewById(R.id.buttonSMS);
        
        // When the button is click it goes to the onClick method and pop
        // up a message that tell the user what the SMS button do.
        buttonSMS.setOnClickListener(this);
        
        // Pass the variable to correspond with the Email button.
        buttonEmail = (Button) findViewById(R.id.buttonEmail);
        
        // When the button is click it goes to the onClick method and pop
        // up a message that tell the user what the Email button do.
        buttonEmail.setOnClickListener(this);
    }

	/*
	 * This method will handle what happen when the user click 
	 * on a particular button.
	 */
	//@Override
	public void onClick(View v) 
	{
		switch(v.getId())
    	{
			case R.id.buttonSpeak: 
									// Display a message that tell the user what the Speak button do.
									Toast.makeText(getBaseContext(), "This button will speak the text you type in.", Toast.LENGTH_LONG).show();
									break;
		
			case R.id.buttonSave: 
									// Display a message that tell the user what the Saved button do.
									Toast.makeText(getBaseContext(), "This button will save the audio file of your text.", Toast.LENGTH_LONG).show();
									break;
		
			case R.id.buttonShare: 
									// Display a message that tell the user what the Share button do.				
									Toast.makeText(getBaseContext(), "This button will share Speak Easy through your email.", Toast.LENGTH_LONG).show();
									break;
		
			case R.id.buttonTweet: 
									// Display a message that tell the user what the Tweet button do.
									Toast.makeText(getBaseContext(), "This button will take you to your twitter to tweet about Speak Easy", Toast.LENGTH_LONG).show();
									break;
		
			case R.id.buttonPost: 
									// Display a message that tell the user what the Post button do.
									Toast.makeText(getBaseContext(), "This button will take you to your Facebook to post about Speak Easy", Toast.LENGTH_LONG).show();
									break;
		
			case R.id.buttonDone: 
									// Display a message that tell the user what the Done button do.
									Toast.makeText(getBaseContext(), "This button will return you to your previous screen", Toast.LENGTH_LONG).show();
									break;
		
			case R.id.buttonDelete: 
									// Display a message that tell the user what the Delete button do.
									Toast.makeText(getBaseContext(), "This button will delete all your saved audio file", Toast.LENGTH_LONG).show();
									break;
									
			case R.id.buttonFolder: 
									// Display a message that tell the user what the Folder button do.
									Toast.makeText(getBaseContext(), "This button will take you to the Saved Audio screen", Toast.LENGTH_LONG).show();
									break;
									
			case R.id.buttonEraser:
									// Display a message that tell the user what the Eraser button do.
									Toast.makeText(getBaseContext(), "This button will delete all your text", Toast.LENGTH_LONG).show();
									break;
									
			case R.id.buttonKeyboard:
									// Display a message that tell the user what the Keyboard button do.
									Toast.makeText(getBaseContext(), "This button will display your keyboard or hide your keyboard", Toast.LENGTH_LONG).show();
									break;
									
			case R.id.buttonSMS:
									// Display a message that tell the user what the SMS button do.
									Toast.makeText(getBaseContext(), "This button will take you to your phone SMS screen", Toast.LENGTH_LONG).show();
									break;
				
			case R.id.buttonEmail:
									// Display a message that tell the user what the Email button do.
									Toast.makeText(getBaseContext(), "This button will take you to your phone Mail screen", Toast.LENGTH_LONG).show();
									break;
		
			case R.id.buttonReturn: 
									// This variable will store the function that will 
									// take the user to the main screen.
									Intent intent = new Intent(getBaseContext(), Text_to_speechActivity.class);
									
									// This will start the transition to the Main screen.
									startActivity(intent);
									break;
    	}
	}
}
